package org.example.controller;

import org.example.controller.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;

@Controller
public class LoginController {
    /**
     * 当前类能被Spring扫描到的情况下
     * 方法上加上@注解可以注册Bean
     * 方法名作为Bean的名称/id,Bean对象为返回值
     * @return
     */

    @Bean
    public Tmp tmp(){
        return new Tmp();
    }
    public static class Tmp{

    }

    @Bean
    public User user(){
        User user=new User();
        user.setPassword("123456");
        user.setUsername("zx");
        return user;
    }


}
